package com.cloud.admin.good.controller;

import com.cloud.admin.good.service.AdsService;
import com.cloud.core.common.BaseDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLException;

/**
 * Created by cloudy.xie on 17/12/13.
 */
@RestController
public class AdsController {
    @Autowired
    private AdsService adsService;

    @Async
    @RequestMapping("/ads/getList")
    public BaseDto getList() throws SQLException {
        return BaseDto.ok(adsService.getCurrentAds());
    }


}